home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / cuj0593.zip / 1105029A < prev    next >
Text File  |  1993-01-19  |  2KB  |  54 lines

  1. // File:     DGEN.SYN
  2. // Copyright Norman Wilde 1993
  3. // AnaGram grammar for a test specification file
  4. //  (partial)
  5.  
  6. grammar
  7.  -> statement..., eof              =writeDriver();
  8. statement
  9.  -> embeddedBlock, space?...
  10.  -> runStatement, space?...
  11.  -> declaration, space?...
  12. embeddedBlock
  13.  -> block:eb                       =addBlock(eb);
  14. runStatement
  15.   -> runHeader, space..., testSpec
  16. runHeader
  17.   -> "runtest", space..., string:n =setRunName(n);
  18. testSpec
  19.   -> "combining", space...,
  20.      variableList:vl, block:b      =makeComb(vl,b);
  21. (struct STRLIST *) variableList
  22.   -> variable:v, space...          =listNew(v,"");
  23.   -> variableList:lst,
  24.      variable:v, space...          =listAdd(lst,v,"");
  25. declaration
  26.  -> intDeclaration
  27.  -> ItemDeclaration
  28.  -> ClientDeclaration
  29.  -> InvoiceDeclaration
  30. // Declaration of a set of integers
  31. intDeclaration
  32.   -> "int", space...,
  33.       variableList:vl, "{", space?...,
  34.       initializorList:il, "}"
  35.             =addTVars(vl,"int","int",il);
  36. // Declaration of a set of Item objects
  37. ItemDeclaration
  38.  -> "Item", space...,
  39.      variableList:vl, "{", space?...,
  40.      initializorList:il, "}"
  41.             =addTVars(vl,"Item","Item&",il);
  42. // Declaration of a set of Client objects
  43. ClientDeclaration
  44.  -> "Client", space...,
  45.      variableList:vl, "{", space?...,
  46.      initializorList:il, "}"
  47.             =addTVars(vl,"Client","Client&",il);
  48. // Declaration of a set of Invoice objects
  49. InvoiceDeclaration
  50.  -> "Invoice", space...,
  51.      variableList:vl, "{", space?...,
  52.      initializorList:il, "}"
  53.            =addTVars(vl,"Invoice","Invoice&",il);
  54.